package DoubanMovie_2;

public class DoubanMovie extends Movie {


    private double score;
    private int number;

    public DoubanMovie(int id, String name, String director, String actor, String date, double score, int number) {
        super(id, name, director, actor, date);
        this.score = score;
        this.number = number;
    }

    @Override
    public double score(double score) {
        return 0;
    }

    public DoubanMovie() {
    }


    public String score_(double score) {
        if (score <= 100) {
            this.score = (score + this.score*this.number) / (this.number+1);
            this.number++;
            String formattedValue = String.format("%.6f", this.score);
            return formattedValue;
        } else {
            System.out.println("输入有误");
            String s = "不合法";
            return s;
        }

    }

    public void getter_douban() {
        String formattedValue = String.format("%.6f", this.score);


    }

    public void show(double score_) {

        score_(score_);
    }

    public void getter() {

        System.out.println(this.id + "\t" + name + "\t" + director + "\t" + actor + "\t" +score);

    }
    @Override
    public int setter () {
        return number;
    }
    public String setname () {
        return name;
    }
}